package top.codedance.iotp.client.plugins.sync.udp.listenner;

import cd.io.netty.channel.ChannelInitializer;
import cd.io.netty.channel.socket.DatagramChannel;
import top.codedance.iotp.client.plugins.sync.udp.UdpClient;

public class UdpInitializer extends ChannelInitializer<DatagramChannel> {
    private UdpClient udpClient;
    public UdpInitializer(UdpClient udpClient){
        this.udpClient = udpClient;
    }

    @Override
    protected void initChannel(DatagramChannel ch) throws Exception {
        ch.pipeline().addLast(new UdpListenner(udpClient));
    }
}
